//
//  NearHistoryViewCell.m
//  BusinessMarket
//
//  Created by Michael Li on 2018/12/17.
//  Copyright © 2018年 Michael Li. All rights reserved.
//

#import "NearHistoryViewCell.h"
#import "HomeModel.h"
#import "ServiceModel.h"
@interface NearHistoryViewCell()
@property (weak, nonatomic) IBOutlet UIImageView *iv;
@property (weak, nonatomic) IBOutlet UILabel *titleL;
@property (weak, nonatomic) IBOutlet UILabel *contentL;
@property (weak, nonatomic) IBOutlet UILabel *lineL;

@end
@implementation NearHistoryViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.iv.layer.masksToBounds = YES;
     self.iv.layer.cornerRadius = 10;
    self.iv.image =[ImageColorHelper createImageWithColor:[UIColor colorWithRed:244/255.0 green:243/255.0 blue:243/255.0 alpha:1]];
    self.iv.layer.borderColor  = [UIColor colorWithRed:187/255.0 green:187/255.0 blue:187/255.0 alpha:1].CGColor;
    self.iv.layer.borderWidth  = 1;
    self.lineL.textColor =kLineColor;
    self.titleL.textColor = [UIColor colorWithRed:107/255.0 green:107/255.0 blue:107/255.0 alpha:1];
    self.contentL.textColor = kLabel16Color;
//    self.titleL.font = [UIFont systemFontOfSize:16];
//    self.contentL.font = [UIFont systemFontOfSize:16];
}

- (void)setIndexPath:(NSIndexPath *)indexPath
{
    _indexPath = indexPath;
}- (void)setIndex:(NSInteger)index
{
    _index = index;
}
- (void)setHomeModel:(HomeModel *)homeModel
{
    _homeModel = homeModel;
   
    [self.iv sd_setImageWithURL:[NSURL URLWithString:homeModel.headImg] placeholderImage:[UIImage imageNamed:@"headImg"]];
    if (homeModel.type == 1) {
        self.titleL.text = [NSString stringWithFormat:@"%@|个人",homeModel.nicakName];
    }else {
        self.titleL.text = [NSString stringWithFormat:@"%@|公司",homeModel.nicakName];
    }
    self.contentL.text = homeModel.represent;
}
- (void)setServieModel:(ServiceModel *)servieModel
{
    _servieModel = servieModel;
    [self.iv sd_setImageWithURL:[NSURL URLWithString:servieModel.images] placeholderImage:[UIImage imageNamed:@"headImg"]];
    self.titleL.text = [NSString stringWithFormat:@"%@|%@|%@",servieModel.associationtype,servieModel.associationtypesub1,servieModel.industryList[0]];
    self.contentL.text = [NSString stringWithFormat:@"业务特色:%@",servieModel.resource];
}
@end
